<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('labor_teams', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('admin_id')->default(0)->index();
            $table->unsignedBigInteger('company_id')->default(0)->index();
            $table->unsignedBigInteger('role_id')->default(0)->index();
            $table->string('name')->nullable()->comment('班组名称');
            $table->string('number')->nullable()->comment('编号');
            $table->string('director')->nullable()->comment('负责人');
            $table->string('id_card')->nullable()->comment('身份证');
            $table->string('id_card_files')->nullable()->comment('负责人身份证复件');
            $table->string('sex')->nullable()->comment('性别');
            $table->string('type')->nullable()->comment('班组类别');
            $table->string('is_cooperate')->nullable()->comment('是否有合作');
            $table->string('work_type_num')->nullable()->comment('工种人数');
            $table->string('contact_mobile')->nullable()->comment('联系电话');
            $table->date('birthday')->nullable()->comment('出生日期');
            $table->string('address')->nullable()->comment('常住地址');
            $table->string('recommended')->nullable()->comment('推荐级别');
            $table->string('is_contract')->nullable()->comment('是否签合同');
            $table->string('remarks')->nullable()->comment('备注');
            $table->string('files')->nullable()->comment('附件上传');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('labor_teams');
    }
};
